package com.taotao.job.core.enums;

import java.util.HashMap;
import java.util.Map;

/**
 * 任务阻塞策略
 *
 * @author fanbeibei
 * @version 1.0
 * @date 2021/2/24 10:18
 */
public enum ExecutorBlockStrategy {
    ;

    private Integer code;

    private String text;


    private static Map<Integer, ExecutorBlockStrategy> codeTextMap = new HashMap<>();

    static {
        ExecutorBlockStrategy[] values = ExecutorBlockStrategy.values();
        for (ExecutorBlockStrategy val : values) {
            codeTextMap.put(val.code, val);
        }
    }


    public static ExecutorBlockStrategy getByCode(Integer code) {

        return codeTextMap.get(code);
    }
}
